import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;

public class PasswordEncrypt {

    public static void main(String[] args) {
        PasswordEncoder passwordEncoder = new BCryptPasswordEncoder() ;
        String encode = passwordEncoder.encode("123456");
        System.out.println(encode);
        boolean matches = passwordEncoder.matches("123456", "$2a$10$bUfE4cOQTkV/Go.9.GkBOuE6LZfeF3tfEcx59o12kTEcdyvRAbcoO");
        System.out.println(matches);
    }
}
